﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Frame.Lib.Data;

namespace Jzy.Model.Account
{
    public partial class AccountInfo : EntityBase
    {
        public override string GetTableName()
        {
            return "Account";
        }
        public override string GetInsertSql()
        {
            return "insert into Account ( [ID], [Name], [IsIncome], [Amount], [OccurTime], [InputTime], [TypeCode], [TypeName], [CreatorID], [CreatorName]) values ( @ID, @Name, @IsIncome, @Amount, @OccurTime, @InputTime, @TypeCode, @TypeName, @CreatorID, @CreatorName)";
        }
        public override string GetUpdateSql()
        {
            return "update Account set  [ID] = @ID, [Name] = @Name, [IsIncome] = @IsIncome, [Amount] = @Amount, [OccurTime] = @OccurTime, [InputTime] = @InputTime, [TypeCode] = @TypeCode, [TypeName] = @TypeName, [CreatorID] = @CreatorID, [CreatorName] = @CreatorName where ID = @ID";
        }
        /// <summary>
        /// 
        /// </summary>
        public Int32 ID
        {
            get;
            set;
        }
        /// <summary>
        /// 描述
        /// </summary>
        public String Name
        {
            get;
            set;
        }
        /// <summary>
        /// 是否收入
        /// </summary>
        public Boolean IsIncome
        {
            get;
            set;
        }
        /// <summary>
        /// 金额
        /// </summary>
        public Decimal Amount
        {
            get;
            set;
        }
        /// <summary>
        /// 发生时间
        /// </summary>
        public DateTime OccurTime
        {
            get;
            set;
        }
        /// <summary>
        /// 录入时间
        /// </summary>
        public DateTime InputTime
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public Int32 TypeCode
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public String TypeName
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public Int32 CreatorID
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public String CreatorName
        {
            get;
            set;
        }
        public override void SetValue(string key, object value)
        {
            key = key.ToLower();
            switch (key)
            {
                case "id":
                    this.ID = (Int32)value;
                    break;
                case "name":
                    this.Name = (String)value;
                    break;
                case "isincome":
                    this.IsIncome = (Boolean)value;
                    break;
                case "amount":
                    this.Amount = (Decimal)value;
                    break;
                case "occurtime":
                    this.OccurTime = (DateTime)value;
                    break;
                case "inputtime":
                    this.InputTime = (DateTime)value;
                    break;
                case "typecode":
                    this.TypeCode = (Int32)value;
                    break;
                case "typename":
                    this.TypeName = (String)value;
                    break;
                case "creatorid":
                    this.CreatorID = (Int32)value;
                    break;
                case "creatorname":
                    this.CreatorName = (String)value;
                    break;
            }
        }
        public override object GetValue(string key)
        {
            key = key.ToLower();
            switch (key)
            {
                case "id":
                    return this.ID;
                case "name":
                    return this.Name;
                case "isincome":
                    return this.IsIncome;
                case "amount":
                    return this.Amount;
                case "occurtime":
                    return this.OccurTime;
                case "inputtime":
                    return this.InputTime;
                case "typecode":
                    return this.TypeCode;
                case "typename":
                    return this.TypeName;
                case "creatorid":
                    return this.CreatorID;
                case "creatorname":
                    return this.CreatorName;
                default:
                    return null;
            }
        }
    }

}
